package com.zx.ecode.model.entity;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.zzp.basepresenter.util.Bean;

public class ECodeBean extends Bean {
    private UserBean userBean;
    private long times;

    /*
     * 将Object转为Json
     * */
    public String ObjectToJson() {
        String json = "";
        ObjectMapper mapper = new ObjectMapper();
        try {
            json = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(this);
        } catch (JsonProcessingException e) {
            e.printStackTrace();
        }
//        LoggerUtils.getInstance().Log("转化JSON\t\t" + json);
        return json;
    }

    public UserBean getUserBean() {
        return userBean;
    }

    public void setUserBean(UserBean userBean) {
        this.userBean = userBean;
    }

    public long getTimes() {
        return times;
    }

    public void setTimes(long times) {
        this.times = times;
    }
}
